/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package test;

import com.nanosn.framework.core.Component;
import com.nanosn.framework.core.ComponentManager;
import com.nanosn.framework.core.ExtensionPoint;
import java.util.Hashtable;

/**
 *
 * @author selkhateeb
 */
public class TodoList extends Component
{
    // <editor-fold defaultstate="collapsed" desc="Private Members">
    private Hashtable<String, String> todos = new Hashtable<String, String>();
    // </editor-fold>

    
    public TodoList(ComponentManager componentManeger) throws Exception
    {
        super(componentManeger);
        super.setExtensionPoints(new ExtensionPoint(super.getComponentManager(), ITodoObserver.class));
    }

    public void add(String name, String description)
    {

        this.todos.put(name, description);


        for (Component component : super.getExtensionPoint(ITodoObserver.class).getComponents())
        {
            ITodoObserver ito = (ITodoObserver) component;
            ito.todo_added(name, description);
        }
    }
}
